package com.ctshk.rpc.booking.enums;

import com.ctshk.common.enums.SystemBusinessType;

import java.util.Objects;

/**
 * 供应商预订类型枚举
 */
public enum SupplierReserveTypeEnum {
    AIR(1348478135995461634L, "机票"),
    TRAIN(1367369966309494786L, "火车票"),
    SHIP(1367370019262582785L, "船票"),
    CAR_RENTAL(1367370062912704513L, "租车"),
    FOOD(1367370042691964929L, "餐饮"),
    HOTEL(1348478092781547522L, "酒店"),
    OTHER(1367370208337612802L, "综费"),
    SCENIC(1367370306144587778L, "门票"),
    BUS(1367370238301720578L, "巴士车票"),
    AIR_EXPRESS(1367370369918980098L, "机场快线"),
    INSURANCE(1367370344572801026L, "保险"),
    STAMP_DUTY(12L, "印花税"),
    VISA(1367370434964246529L, "签证"),
    LOCAL_FUN(14L, "当地玩乐"),
    COMMODITY(15L, "商品");

    private Long id;
    private String name;

    SupplierReserveTypeEnum(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public static String parseNameById(long id) {
        for (SupplierReserveTypeEnum type : SupplierReserveTypeEnum.values()) {
            if (Objects.equals(type.id, id)) {
                return type.name();
            }
        }
        return null;
    }

    public static SupplierReserveTypeEnum parseById(long id) {
        for (SupplierReserveTypeEnum type : SupplierReserveTypeEnum.values()) {
            if (Objects.equals(type.id, id)) {
                return type;
            }
        }
        return null;
    }
}
